// @ 符号在build/webpack.base.conf.js 中配置 表示 'src' 路径
import request from '@/utils/request'

function pageList(page, limit, searchObj) {
  return request({
    url: `/admin/edu/teacher/list/${page}/${limit}`,
    method: 'get',
    params: searchObj
  })
}
function list() {
  return request({
    url: '/admin/edu/teacher/list',
    method: 'get'
  })
}
function removeById(id) {
  return request({
    url: `/admin/edu/teacher/deleteById/${id}`,
    method: 'delete'
  })
}
function save(teacher) {
  return request({
    url: 'admin/edu/teacher/insert',
    method: 'post',
    data: teacher
  })
}
function getById(id) {
  return request({
    url: `admin/edu/teacher/getById/${id}`,
    method: 'get'
  })
}
function updateById(teacher) {
  return request({
    url: 'admin/edu/teacher/updateById',
    method: 'put',
    data: teacher
  })
}
function batchRemove(idList) {
  return request({
    url: '/admin/edu/teacher/batch-remove',
    method: 'delete',
    data: idList
  })
}
function selectNameListByKey(key) {
  return request({
    url: `/admin/edu/teacher/list/name/${key}`,
    method: 'get'
  })
}
export default {
  pageList,
  list,
  removeById,
  save,
  getById,
  updateById,
  batchRemove,
  selectNameListByKey
}

